<div ng-controller="KefuCtrl" ng-init="wxkfaddAction()" class="sui-form form-horizontal">
    <ul class="sui-breadcrumb">
        <li>
            <a href="#/kefu/add?wxapp_id={{wxapp_id}}">{{'客服消息设置' | translate}}</a>
        </li>
        <li class="active">{{'edit' | translate}}</li>
    </ul>
    <div>
        <form name="itemForm" novalidate >
        <div class="control-group">
            <label class="control-label v-top" style="width: 160px;">
                公众号消息回复设置:
            </label>
            <div class="controls">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top" style="width: 160px;">
                事件:
            </label>
            <div class="controls">
                <span ng-show="!kf.kf_id"><wx-event ng-model="kf.event" dft="1" ></wx-event></span>
                <span ng-show="kf.kf_id"><wx-event ng-model="kf.event" stype='1' ></wx-event></span>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top" style="width: 160px;">
                场景:
            </label>
            <div class="controls">
                <span ng-show="!kf.kf_id"><wx-eventkey-type ng-model="kf.eventtype" dft="1" ></wx-eventkey-type></span>
                <span ng-show="kf.kf_id"><wx-eventkey-type ng-model="kf.eventtype" stype='1' ></wx-eventkey-type></span>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top" style="width: 160px;">
                备注:
            </label>
            <div class="controls">
                <textarea rows="3" ng-model="kf.desc" class="input-xlarge ng-pristine ng-valid ng-empty ng-touched" style=""></textarea>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label v-top" style="width: 160px;">所属标签:</label>
            <div class="controls">
                <div>
                    <wx-tags-list ng-model="kf.tag" wxappid="wxapp_id"></wx-tags-list> 
                </div>
                <div  class="sui-msg msg-error msg-clear help-block error">
                    <div class="msg-con"><a href="#/gzhlabel/add?wxapp_id={{wxapp_id}}">创建标签</a></div>
                    <!-- <s class="msg-icon"></s> -->
                </div>
            </div>
        </div>
    
        <div class="control-group">
            <label class="control-label v-top" style="width: 160px;">
                回复类型:
            </label>
            <div class="controls">
                <div ng-repeat="(msgkey, submsgcode) in kf.msgcode">
                    <kf-type-tab ng-model="submsgcode.msgtype" style="width: 350px"></kf-type-tab>
                    <div class="controls" ng-if="submsgcode.msgtype == 1 ">
                        <textarea rows="3" ng-model="submsgcode.title" class="input-xlarge ng-pristine ng-valid ng-empty ng-touched" style=""></textarea>
                    </div>
                    <div class="controls" ng-if="submsgcode.msgtype == 2 ">
                        <wx-gzh-url-attachment id="wx2uploadattach" owner-id="attachs" dhf-ng-model="submsgcode.imgUrl1" xtype="mid" mult="false" title="添加图片" use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF" wxappid="wxapp_id" setback="addimgurl(attach,submsgcode)" datatype="1"></wx-gzh-url-attachment>
                        <img ng-src="{{submsgcode.imgUrl1}}" style="width: 250px;height: 150px">
                    </div>
                    <div class="controls" ng-if="submsgcode.msgtype == 3 ">
                        <wx-gzh-url-attachment id="wx3uploadattach" owner-id="attachs" dhf-ng-model="submsgcode.imgUrl1" xtype="mid" mult="false" title="添加语音" use-type="mp3,wma,wav,amr" wxappid="wxapp_id" setback="addimgurl(attach,submsgcode)" datatype="1"  chosed-status="voice" ></wx-gzh-url-attachment>
                        <img ng-src="{{submsgcode.imgUrl1}}" style="width: 250px;height: 150px">
                    </div>
                    <div class="controls" ng-if="submsgcode.msgtype == 4 ">
                        <span>
                        标题: <input ng-model="submsgcode.title" type="text" value="" class="input-xlarge">
                        </span>
                        <br/>
                        <br/>
                        <span>
                        描述: <textarea rows="3" ng-model="submsgcode.description" class="input-xlarge ng-pristine ng-valid ng-empty ng-touched" style=""></textarea>
                        </span>
                        <br/>
                        <span>
                        视频: <kefu-img ng-model="submsgcode.media_id" appid="wxapp_id" apply-type="subscribe_reply_info"></kefu-img>
                        </span>
                        <br/>
                        <span>
                        视频缩略图: 
                        <wx-gzh-url-attachment id="wx4uploadattach" owner-id="attachs" dhf-ng-model="submsgcode.imgUrl2" xtype="mid" mult="false" title="添加图片" use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF" wxappid="wxapp_id"  setback="addimgurl(attach,submsgcode,'1')"  datatype="1" ></wx-gzh-url-attachment>
                        <img ng-src="{{submsgcode.imgUrl2}}" style="width: 250px;height: 150px">
                    </span>
                    </div>
                    <div class="controls" ng-if="submsgcode.msgtype == 5 ">
                        选择小程序：
                        <wx-app-list ng-model="submsgcode.app_id" ary="storeary" storedata="1"> </wx-app-list>
                        <input ng-model="submsgcode.app_id" type="text" value="" class="input-xlarge">
                        <br/>
                        <br/>
                        <span>
                        标题: <input ng-model="submsgcode.title" type="text" value="" class="input-xlarge">
                        </span>
                        <br/>
                        <br/>
                        <span>
                        路径: 
                        {{submsgcode.pagepath}}
                        <a-url setback="savepath(path,submsgcode)" pagepath="submsgcode.pagepath"  rm="1" ></a-url>
                        </span>
                        <br/>
                        <br/>
                        <span>
                        小程序文本图: 
                        <wx-gzh-url-attachment id="wx4uploadattach" owner-id="attachs" dhf-ng-model="submsgcode.imgUrl2" xtype="mid" mult="false" title="添加图片" use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF" wxappid="wxapp_id"  setback="addimgurl(attach,submsgcode,'1')"  datatype="1" ></wx-gzh-url-attachment>
                            <img ng-src="{{submsgcode.imgUrl2}}" style="width: 250px;height: 150px">
                        </span>
                    </div>
                    <br/>
                    <button type="button" ng-show="msgkey" class="sui-btn btn-danger" ng-click="kf.msgcode.splice($index,1)" >{{'delete'|translate}}</button>
                    <br/>
                    <br/>
                </div>
                <div>
                    <a href="javascript:;" class="sui-btn btn-success btn-small" ng-click="addMsg();" style="margin-bottom: 10px;">+{{'新增回复类型'|translate}}</a>
                </div>
            </div>
        </div>
        
        <div class="control-group">
            <label class="control-label"></label>
            <div class="controls">
                <button type="button " class="sui-btn btn-success " ng-click="kefuAddphp() ">
                    <span>{{'save' | translate}}</span>
                </button>
            </div>
        </div>
        </form>
    </div>
</div>